<? 
//$datoarrayet kan bruges, hvis der er en særlig dato man gerne vil have vist i tidsformen, når den hentes ind. Hvis den ikke er sat, bliver den defineret herunder:
if(!isset($datoarray2))
{
		$datoarray2 = array(
		'aar' => 400,
		'maaned' => 1,
		'dag' => 1,
        'time' => NULL,
        'minut' => NULL
		);
}



?>
<p id="tid2" class="rubrik">		



						
			<select class="dag2" name="dag_2">
			<? 
			
			function skriv_dag_2($k, $valgt2)
			{
				if($k<32)
				{
					?><option id="x<? echo $k; ?>" value="<? echo $k; ?>" <? if($k == $valgt2){ echo "selected='selected'"; } ?> ><? echo $k; ?></option><?
					
					
					skriv_dag_2($k+1, $valgt2);
				}	
			}
			
			skriv_dag_2(1, $datoarray2['dag']);
			
			?>
			</select>

			<select class="maaned2" name="maaned_2">
				<option value="1" <? if($datoarray2['maaned'] == 1){ echo "selected='selected'"; } ?>>januar</option>
				<option value="2" <? if($datoarray2['maaned'] == 2){ echo "selected='selected'"; } ?>>februar</option>
				<option value="3" <? if($datoarray2['maaned'] == 3){ echo "selected='selected'"; } ?>>marts</option>
				<option value="4" <? if($datoarray2['maaned'] == 4){ echo "selected='selected'"; } ?>>april</option>
				<option value="5" <? if($datoarray2['maaned'] == 5){ echo "selected='selected'"; } ?>>maj</option>
				<option value="6" <? if($datoarray2['maaned'] == 6){ echo "selected='selected'"; } ?>>juni</option>
				<option value="7" <? if($datoarray2['maaned'] == 7){ echo "selected='selected'"; } ?>>juli</option>
				<option value="8" <? if($datoarray2['maaned'] == 8){ echo "selected='selected'"; } ?>>august</option>
				<option value="9" <? if($datoarray2['maaned'] == 9){ echo "selected='selected'"; } ?>>september</option>
				<option value="10" <? if($datoarray2['maaned'] == 10){ echo "selected='selected'"; } ?>>oktober</option>
				<option value="11" <? if($datoarray2['maaned'] == 11){ echo "selected='selected'"; } ?>>november</option>
				<option value="12" <? if($datoarray2['maaned'] == 12){ echo "selected='selected'"; } ?>>december</option>
			</select>
			
			<select name="aar_2">
				<?

				//echo $datoarray2['aar'];
				
				function skriv_aar_2($j, $valgt2)
				{
					if($j<1000)
					{
						?>
						<option value="<? echo $j; ?>" <? if($j == $valgt2){ echo "selected='selected'"; } ?> > <? echo $j; ?> </option>
						<?
						$j = $j+1;
						skriv_aar_2($j, $valgt2);
					}
	
				}
				skriv_aar_2(1, $datoarray2['aar']);
			?>
			</select>
         <span id="klokken2" style="float:right;display:none;">klokken:
                <input type="text" name="time_2" style="width:20px;height:10px;" >:
                <input type="text" name="minut_2" style="width:20px;height:10px;" value="00">
          </span>

            <select name="alder_2">
                    <option value="50">Efter Culost' Fald</option>
                    <option value="49">Den Gyldenrøde Tidsalder</option>


            </select>
         <a href="#" class="rubrik" id="klokken_link2" onClick="hidestuff('klokken_link2');showstuff('klokken2')"> </a>

</p>

<script type="text/javascript">
//$(document).ready(function() {

    function maaned_check2() {

       var maaned2 = $('select.maaned2 option:selected').val();

       if(maaned2 == "2") {

           $("#x29").hide();
           $("#x29").removeAttr("selected");
           $("#x30").hide();
           $("#x30").removeAttr("selected");
           $("#x31").hide();
           $("#x31").removeAttr("selected");

       }
       else if(maaned2 == "4" || maaned2 == "6" || maaned2 == "9" || maaned2 == "11") {

           $("#x29").show();
           $("#x30").show();
           $("#x31").hide();
           $("#x31").removeAttr("selected");
       }
       else { 

           $("#x29").show();
           $("#x30").show();
           $("#x31").show();
       }
       

    }

    $(window).load(maaned_check2);
    $("#tid2").change(maaned_check2);
    
//});
</script>

